let express = require('express');

let path = require('path');

let app = express();

// 静态化目录
app.use('/', express.static(path.join(process.cwd(), './')));


app.get('/get', (req, res) => {
    res.json({error: 0, data: 'success'});
})

app.post('/post', (req, res) => {
    res.json({error: 0, data: 'post请求成功'});
})


app.listen(3000, () => console.log('监听端口号成功'));